Applications involving data processing (e.g., data received from sensors) may require digital filtering. In applications where high performance digital filtering is required, a dedicated Digital Signal Processor (DSP) may be used. In some low performance applications, however, a DSP can be too expensive and power-consuming to be a viable solution. An efficient alternative to the DSP is an 8-bit or 16-bit microcontroller, which can be configured to implement digital filtering operations. Some conventional microcontrollers provide the additional advantage of including Input/Output (I/O) features and communication modules that may not be included in a typical DSP.
An example of a conventional 8-bit microcontroller is the 8051 microcontroller, which uses the MCS-51 instruction set. In the past, DSP applications have typically not been implemented on the 8051 microcontroller due to its relatively poor performance in performing DSP operations. However, high-performance, single-cycle implementations of the 8051 microcontroller have now made the 8051 microcontroller a viable option for DSP applications.
DSP algorithms that implement digital filters typically rely on computing a sum of products given by
                    Y        =                              ∑                          i              =              0                        N                    ⁢                                    A              ⁡                              (                i                )                                      ·                          X              ⁡                              (                i                )                                                                        (        1        )            , where Y is the sum of products result, A(i) is a coefficient value, X(i) is a sample value, i is an index value and N is the number of filter taps.
Referring to equation [1], for each iteration of the summation operator, a product is computed and added to a running sum. Such operation is often referred to as a Multiply-Accumulate (MAC) operation when implemented in hardware. Central Processing Units (CPUs) used in microcontrollers typically can implement a MAC operation entirely in software. Implementing a MAC operation in software, however, can increase overhead, especially when implementing the MAC algorithm with 16-bit precision on an 8-bit CPU. For example, implementing a single MAC iteration on a conventional 8051 microcontroller can use from 100 to 1,800 clock cycles (worst case) to compute a single product and add it to the sum. Since N+1 products are needed for one output value, the computation time for performing a MAC operation in software can become quite large.